package com.heima.user.feign;

import com.heima.feign.user.IUserFeignClient;
import com.heima.model.user.pojos.ApUser;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ItZheng
 * @Date 2023/6/28 14:57
 * @Version 1.5
 */
@RestController
public class ApUserClient implements IUserFeignClient {

    @Autowired
    private ApUserService apUserService;

    /**
     * 根据用户Id查询信息
     * @param id
     * @return
     */
    @Override
    @GetMapping("/api/v1/user/findById/{id}")
    public ApUser findUserById(@PathVariable("id") Integer id) {
        ApUser apUser = apUserService.getById(id);
        return apUser;
    }
}
